home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 2: CDPD 1 / Almathera Ten on Ten - Disc 2: CDPD 1.iso / pd / 576-600 / 581 / neuro / neuro.doc < prev    next >
Text File  |  1995-03-15  |  16KB  |  369 lines

  1.  
  2.  
  3.                                  ---------
  4.                                  | Neuro |
  5.                                  ---------
  6.  
  7.                         A neural network simulator
  8.                                 Version 1.0
  9.  
  10.                                     by
  11.                                Berthold Ruf
  12.                                     and
  13.                                Ulrich Wisser
  14.  
  15.  
  16.  
  17.  Contents:
  18.  =========
  19.      0.  ............. Copyright
  20.      1.  ............. Introduction
  21.      2.  ............. Getting started
  22.      3.  ............. Description of the menu items
  23.      3.1 .................. Project
  24.      3.2 .................. Action
  25.      3.3 .................. Settings
  26.      4.  ............. Notes to the internal structure of the program
  27.      5.  ............. Known Bugs
  28.      6.  ............. Appendix
  29.  
  30.  
  31.  
  32. 0. Copyright:
  33. =============
  34.  
  35. This  program  is  shareware  and NOT (!) public domain.  When copying this
  36. program be sure to include the following files:
  37.  
  38.      -neuro                       the program
  39.      -neuro.doc                   this documentation
  40.      -req.library                 copy this file to your libs: directory
  41.                                   Thanks to Bruce & Colin for the excellent
  42.                                   library. Their address is:
  43.                                            Bruce Dawson, Colin Fox
  44.                                            Box, 1215 Daviestreet.
  45.                                            Vancouver, B.C., V6E 1N4
  46.      -data/Numbers                demonstrates, how the net can recognize
  47.                                   numbers, works very well
  48.      -data/Encoder                Example of finding an internal
  49.                                   binary-like representaion
  50.      -data/Letters                the letters in a 5x5-representation are
  51.                                   all quite simular, one pixel is used by
  52.                                   many patterns, this example shows the
  53.                                   problems for neural networks to learn
  54.                                   patterns like these.
  55.      -data/Pattern05x05.06        very easy to learn, try it yourself!
  56.      -data/Pattern10x10.04        works in Hopfield-mode quite well
  57.  
  58.  
  59. IT  IS  FORBIDDEN TO SPREAD THE PROGRAM SKIPPING ONE OF THESE FILES OR WITH
  60. ANY  FILE BEING ALTERED!  REMEBER THIS PROGRAM IS STILL UNDER COPYRIGHT AND
  61. BY  THIS REASON PROTECTED BY LAW!  THE AUTHORS DON'T GUARANTEE ANY FUNCTION
  62. OF  THE  PROGRAM  AND ARE NOT LIABLE FOR ANY DAMAGE RESULTING IN THE USE OF
  63. THIS PROGRAM!
  64.  
  65.  
  66. If  you  like  this  program  and use it more frequently, please send DM 20
  67. (Europe) or $20 (Oversea) to:
  68.  
  69.                        Berthold Ruf / Ulrich Wisser
  70.                               Mauerstrasse 44
  71.  
  72.                                W-5100 Aachen
  73.                                   Germany
  74.  
  75.  
  76. You will get a free update of the next version, as soon as it is available.
  77.  
  78. If  you  have  any  questions  concerning  our  program  or suggestions for
  79. improving it, please write or email us.  Our internet-addresses are:
  80.  
  81.                    ruf@cip-s01.informatik.rwth-aachen.de
  82.                  wisser@cip-s01.informatik.rwth-aachen.de
  83.  
  84.                            voice : +49-241-33176
  85.  
  86.  
  87. Many  thanks  to  our beta-testers, who have helped to improve our program.
  88. Especially AnTu did a great job.  He also created the nice icon.
  89.  
  90.  
  91. 1. Introduction:
  92. ================
  93.  
  94. The  program "Neuro" is a neural network simulator.  It learns patterns and
  95. recognizes them, also if the input is incomplete!  It can for example learn
  96. the pixel representation of some letters.  After the user entered a part of
  97. a pattern the network will complete this pattern.
  98.  
  99. Used  in  the  mode "Backpropagation" it finds internal represantations for
  100. patterns.   So  the  net is able to "discover" the binary code for example,
  101. when  it  has  to  learn 8 patterns, but has only 3 Bits (hidden units), to
  102. represent  them  internally (known as the Encoder-problem, see the included
  103. example-file "Encoder").
  104.  
  105.  
  106. Two types of neural networks are implemented in this version:
  107.                              -Backpropagation
  108.                              -Hopfield
  109. In the next version we also plan to realize the Boltzmann-mashine.
  110.  
  111. It  is  not possible to give a full explanation here, if you are interested
  112. in  details,  please  refer  to  the  books  listed  in  the appendix.  The
  113. backpropagation-algorithm  is  probably  the  one  which might get the best
  114. results.  The net is able to learn most of the pattern-association problems
  115. very  well.  The hopfield-net also very often produces good results, though
  116. it  can't  distinguish  between  a  pattern and its reverse partner, so you
  117. might sometimes get a reverse pattern as an answer.  Unfortunately it has a
  118. very small capacity so you can't enter too many patterns.  In this case you
  119. will  get a warning message.  
  120.  
  121. The programm offers the opportunity, to explore the possibilities (but also
  122. the limitations) of neural networks.
  123.  
  124.  
  125. 2. Getting started:
  126. ===================
  127.  
  128. Before starting you should copy the "req.library" to your libs:  directory.
  129. The program is started from CLI (or shell) with the command
  130.  
  131.                                    neuro
  132.  
  133. or  from  the  workbench  by  doubleclicking  the  Icon.  No parameters are
  134. necessary.
  135.  
  136. For  a first try, select "Load all" in the menu "project" and load the file
  137. "data/Numbers".   You have loaded now a neural network which has learned to
  138. recognize  the  ten  digits  (0-9).  To see them, select "info" in the menu
  139. "project".   Now  press  a  key  or  a  mouse  button  and  select the item
  140. "question"  in  the menu "Action".  You now will see three grids.  The left
  141. one  is for your input, the middle one shows the internal representation of
  142. your  input  and  the  right one shows the answer of the network.  Click in
  143. some  squares  of  the  input  grid, so that it looks simular to one of the
  144. digits  as  shown  in  the  info.  Now click "question" in order to see the
  145. answer of the network.  If it doesn't look simular to one of the digits you
  146. can  take  this  answer again as an input by selecting the gadget "Retake".
  147. You  also  can  find  out,  how  certain the network is about its answer by
  148. clicking into "Black&White" which then will change to "Grey":  Some squares
  149. will become grey.  The more black a square is, the more sure the network is
  150. that this square has to be black.
  151.  
  152.  
  153. 3. Description of the menu items:
  154. =================================
  155.  
  156. 3.1 Project:
  157. ----------------------
  158.  
  159. -Load:   You  either  can  load  the patterns only or the patterns plus all
  160.  parameters  and the  weights  of  the  matrix  (the result of the learning
  161.  process).  When  the  program is started you either must load something or
  162.  generate a new pattern file with the included editor (see below).
  163.  When you select "Load patterns", an ASCII-file containing the descritption
  164.  of the patterns to be learned is loaded. For a detailed descritpion of the
  165.  structure of the ASCII-file see chapter 4.
  166.  The  file  loaded  by  "Load  all" is a Non-ASCII-file.  It contains the
  167.  patterns,  the  mode  of the net (Backpropagation/Hopfield), the
  168.  weights  and the current values of the parameters, which can be changed in
  169.  the "Setting/parameter" menu.
  170.  
  171. -Save:   You  only  can save the patterns with this menu item, which is not
  172.  nessessary  since  you have generated or changed patterns with the editor.
  173.  After  learning, you should choose "Save all" in order to save the results
  174.  of the learning process.
  175.  
  176. -Clear:   This  will  reset the complet program.  All patterns and learning
  177.  results will be deleted!
  178.  
  179. -Edit:  This is a very simple editor, but it works and it should suffice to
  180.  create or change patterns.
  181. --New:   If  you want to create a completely new pattern file, select "Edit
  182.   new"  (the  old patterns in memory will be forgotten then!).  You have to
  183.   tell  the  editor,  how  many  rows  and columns you want to use for your
  184.   patterns.   Then  you can click with the mouse in these squares which you
  185.   want  to  have  black  in  your pattern.  When finished, select "Take" in
  186.   order  to  use  this  pattern.   The grid should become empty and you can
  187.   generate  the  next  one.   You can page through the patterns forward and
  188.   backwards  using  the "Prev" and "Next" gadgets.  If you want to remove a
  189.   pattern from the list choose "Remove".  To clear the grid choose "Clear".
  190.   A maximum of 30 patterns can be edited.
  191. --Old:   You  can change your edited patterns later or a given pattern file
  192.   by  selecting  "Edit old", which always refers to the current patterns in
  193.   memory.
  194.  
  195. -Info:   Gives  information about free memory, size, number, parameters and
  196.  layout  of  the patterns.  When the mode is set to backpropagation it also
  197.  displays  the  learning  error.   The net has performed its task very well
  198.  when the error is nearby zero.  It can take a few seconds to calculate it,
  199.  so don't panic!
  200.  
  201. -About: To see the beautiful greeting-picture again.
  202.  
  203. -Quit:  should be no problem!
  204.  
  205.  
  206. 3.2 Action:
  207. -----------
  208.  
  209. -Learn:   Selecting  "learn"  starts  either  the  backpropagation-  or the
  210. hopfield-learning  algorithm,  depending  on  your  choice of the mode.  
  211.  
  212.  If  the  learning-process  is  normally  completed, you'll get the message
  213.  "Learning   finished!!!".    If   you  have  choosen  the  backpropagation
  214.  algorithm, you have to enter the number of learning iterations, that means
  215.  how often a (randomly choosen) pattern is presented to the net in order to
  216.  learn it.  In most cases you will need 500 to 20000 iterations to get good
  217.  results.   It can sometimes take a few hours (depending on the size of the
  218.  patterns)  to  finish.   A display shows, how many iterations are still to
  219.  do,  it  is  refreshed always after 10 iterations (in order to save time).
  220.  By striking any key a requester will apear and ask you, if you really want
  221.  to  abort.   Select  Abort  to abort or continue to (guess what) continue.
  222.  The  results  up  to  this  moment won't be lost!.  In Hopfield mode for a
  223.  pattern  file  it's  only  necessary  to  call  this menu item once and it
  224.  doesn't make sense here to call "Learn" several times.
  225.  
  226. -Question:   After  selecting  "question", a window will appear, displaying
  227.  the  mode (of the network) in the first line .  Below you see three grids:
  228.  the  left  one  is for your input, the right one is used by the network to
  229.  display  the  answer  of  the  network to your question and the middle one
  230.  displays the hidden units of the network (not in the Hopfield-mode), which
  231.  show the internal represantation of the current pattern.
  232.  
  233.  Click  with  the left mouse button in those squares of the input grid, you
  234.  want to have black.  After clicking the "question"-gadget the network will
  235.  begin  its  search.   In  Hopfield-mode  you  can see on the left side the
  236.  current energy-value.  Here it can take a while until you see the answer.
  237.  
  238.  "Clear" will clear all three grids.
  239.  
  240.  "Re-Take"  (in Backpropagation-mode) will take the current output again as
  241.  a input and automatically start the query.
  242.  
  243.  "Black&White" / "Grey" is only available in the Backpropagation-mode.  The
  244.  hidden  units  and  the output units contain internally values between 0.0
  245.  and  1.0.   In "Black&White"-mode all values higher than 0.5 are displayed
  246.  black  the  other  values  are displayed white.  In "Grey"-mode the values
  247.  from  0.0  to  0.1  are displayed white, the values from 0.1 to 0.2 in the
  248.  brightest  grey  and  so  on.   So  in  this mode you get more information
  249.  espacially about how certain the net is about its answer.
  250.  
  251.  "Go-On"  (only  in  Hopfield-mode)  :  If the network has found a solution
  252.  which  does not correspond to one of the given patterns, it is possible to
  253.  "unlearn"  this  pattern  by  clicking  "Go-On".   This  will  reduce  the
  254.  probability  of finding this solution.  You should not use this option too
  255.  often.   The  efficiency  of  this  unlearning-procedure  is  given by the
  256.  parameter Mu (see below).
  257.  
  258.  
  259.  
  260. 3.3 Settings:
  261. -------------
  262.  
  263. -Parameter:   Here  you can set several parameters for the current selected
  264.  mode.   For  all  parameters  there  is  a  default-value,  which  will be
  265.  displayed  here  and  used  by  the algorithm unless you change the value.
  266.  When  entering erroneous values outside of the allowed interval the screen
  267.  will flash and the entered value will be replaced by the default value.
  268. --Backpropagation:   Eta determines the learning rate and must have a value
  269.   between  0  and  1.   The bigger Eta, the faster the net will learn.  But
  270.   with  a  value of Eta nearby 1, there will the danger, that the net won't
  271.   learn  all  patterns.  It's sometimes a good strategy to begin with large
  272.   values  and  then  to  reduce  Eta  down  to  a  very small value.  Theta
  273.   determines  the  bias of each unit (see literature) and should have small
  274.   positive  or  negative values.  The number of hidden units tells the net,
  275.   how  many  units  it  can  use  to find an internal representation of the
  276.   patterns.  As a default value there is one hidden unit for one pattern.
  277. --Hopfield:   Theta:   As in Backpropagation.  Mu:  Must be between 0 and 1
  278.   and  influences  the  unlearning-procedure  invoced  by  "Go-On"  in  the
  279.   question-requester.   The  current  output  pattern  will  be  completely
  280.   deleted, if Mu=1.0.  Unfortunately it also will reduce the probability of
  281.   finding the other patterns.  With Mu=0.0 "Go-On" will cause no changes in
  282.   the weights.  In this case the net only will continue its search.
  283.  
  284. -Mode:   Here you can set the program to one of the two implemented network
  285.  types  (boltzmann will be realized in our next version).  The behaviour of
  286.  the complete program depends on your choice in this menu item.
  287.  
  288. -Status:   This  is  only  for  specialists  of  interest.  It displays the
  289.  weight-matrix in  a  very  (!) simple way.  In our next version we plan to
  290.  improve  this display.  You see a lot of "+" and "-", where "+" stands for
  291.  exhibitory  connections  (weight  >= 0.0) , "-" for inhibitory connections
  292.  (weight < 0.0).
  293.  
  294. -Random-Gen.:   The  random  number  generator  is  always initialized by a
  295.  special variable called Seed. In order to change the random aspects of the
  296.  networks  (e.g.  when initializing the weights with random values) you can
  297.  change the Seed-value. Seed must be in the range of 0..65536.
  298.  
  299. -Colour:   If  you  like  it,  you can change the colours.  The last eleven
  300.  colours are  used  for  the  grey-scaled  representation of the answers in
  301.  backpropagation-mode and should change continuously (use spread).
  302.  
  303. -Close WB:  Closes the workbench, if there are no open windows with running
  304.  programs. The workbench will open again when you quit the program.
  305.  This option may speed up the program a bit.
  306.  
  307. 4. Notes to the internal structure of the program
  308. =================================================
  309.  
  310. The pattern file is an ASCII file which has the following structure:
  311.  
  312. 1.line : Number of patterns
  313. 2.line : Number of columns
  314. 3.line : Number of rows
  315. Then  in  each line follows one line of the pattern containing only '.' and
  316. '*'.  The patterns are separated one blank line. Even the last Pattern needs +
  317. this blank line.
  318.  
  319. If  you  have,  for  example,  two  patterns with 7 rows and 8 columns, the
  320. pattern file looks like this:
  321. 2
  322. 8
  323. 7
  324. ...**...
  325. ..***...
  326. .****...
  327. ...**...
  328. ...**...
  329. ...**...
  330. ...**...
  331. .******.
  332.  
  333. ..****..
  334. .**..**.
  335. .....**.
  336. ....**..
  337. ...**...
  338. ..**....
  339. .**.....
  340. .******.
  341.  
  342. (eof)
  343.  
  344. The  name-convention  of  the  pattern-files is:
  345.        "Pattern" + #Rows + "x" + #Columns + "." + #Patterns.
  346. So  "Pattern10x08.15" stands for a pattern file with 15 patterns, having 10
  347. rows and 8 columns.
  348.  
  349. The files created by "Save all" can't be edited by an editor.
  350.  
  351.  
  352. 5. Known Bugs:
  353. ==============
  354.  
  355. When entering erroneous parameters into a gadget, the cursor in this gadget
  356. will not disappear.
  357. If you should find more bugs, we'd be happy to get a note from you!
  358.  
  359. 6. Appendix:
  360. ============
  361.  
  362. Interesting books:
  363.  
  364. J. McClelland, D. Rumelhart: Parallel Distributed Processing. Explorations
  365. in the Microstructure of Cognition. The MIT Press 1986.
  366.  
  367. E. Schoeneburg. Neuronale Netzwerke. Markt und Technik 1990. (in german)
  368.  
  369.